﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace DataBaseReverseGenerator.DataBaseModel
{
    [Serializable]
    public class Table
    {
        #region Ctor

        public Table()
        {
            this.columns = new List<Column>();
            this.primaryKeys = new List<string>();
        }

        public Table(string name) : this()
        {
            this.name = name;
        }

        #endregion

        #region Properties

        private string schema;
        [XmlAttribute()]
        public string Schema
        {
            get { return schema; }
            set { schema = value; }
        }


        private string name;
        [XmlAttribute()]
        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        private List<Column> columns;
        public List<Column> Columns
        {
            get { return columns; }
            set { columns = value; }
        }

        private List<string> primaryKeys;
        [XmlArray("PrimaryKeys")]
        [XmlArrayItem("Column")]
        public List<string> PrimaryKeys
        {
            get { return primaryKeys; }
            set { primaryKeys = value; }
        } 
        #endregion

    }
}
